import request from '@/utils/request'

//查询活动内容列表
export function listActivities(data) {
  return request({
    url: '/promotion/config/query',
    method: 'post',
    data: data
  })
}

//添加活动内容
export function addActivities(data) {
  return request({
    url: '/promotion/config/save',
    method: 'post',
    data: data
  })
}

//添加活动内容
export function addItemActivities(data) {
  return request({
    url: '/promotion/config/saveItem',
    method: 'post',
    data: data
  })
}

//添加/修改树懒用户端活动内容
export function editUserActivities(data) {
  return request({
    url: '/promotion/config/saveAll',
    method: 'post',
    data: data
  })
}

//删除树懒用户端活动内容
export function deletetUserActivities(data) {
  return request({
    url: '/promotion/config/deleteAll',
    method: 'get',
    params: data
  })
}

//修改活动内容
export function updateActivities(data) {
  return request({
    url: '/promotion/config/save',
    method: 'post',
    data: data
  })
}

//删除主活动内容
export function deleteActivities(adId) {
  return request({
    url: '/promotion/config/delete?id='+adId,
    method: 'get'
  });
}

//删除子活动内容
export function deleteItemActivities(adId) {
  return request({
    url: '/promotion/config/deleteItem?subId='+adId,
    method: 'get'
  });
}
